<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>个人信息</title>

    <!--<meta name="decorator" content="default  footer"/>-->
    <meta name="decorator" content="footer"/>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>

    <script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
        $(document).ready(function () {
            $('#file_upload').uploadify({
                'swf': '${ctxStatic}/uploadify/uploadify.swf',
                //'uploader'：若是上传路径
                'uploader': '${ctx}/oa/personSigns/saveContractFile',
                'buttonText': '请选择要上传的图片',
                'height': 25,
                'width': 150,
                'auto': false,
                'fileTypeExts': '*.*',
                "fileObjName": 'file',
                'multi': false,
                'onUploadSuccess': function (file, data, response) {
                    console.log(file);
                    //若是上传成功，跳转的页面
                    location.href = "${ctx}/oa/personSigns/list";
                },
                'onCancel': function () {
                    flag = false;
                },
                'onSelect': function () {
                    flag = true;
                },
                'onUploadStart': function (file) {
                    $("#file_upload").uploadify("settings", "formData", {
                        'name': $("#name").val(),'signName':$("#signName").val(),
                        'id':$("#id").val()
                    });
                }
            });
            $("#btnSubmit").on("click", function () {
                $('#file_upload').uploadify('upload', '*');
            })

        });
	</script>
    <link rel="stylesheet" href="${ctxStatic}/oaApp/css/oaApp.css"/>
</head>
<body style="margin-top:0;">

<!--Header-part-->
<%--<div id="header">--%>
    <%--<h1>--%>
        <!--<a href="dashboard.html">极目云OA办公系统</a>-->
    <%--</h1>--%>
<%--</div>--%>
<div class="title_Infor">
    <a href="${ctx}/sys/user/myPhone" class="pull-left"><img src="${ctxStatic}/oaApp/img/liucheng_Icon/fanhui.png" />返回</a>

    <h3 >个人信息</h3>


</div>


	<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/info" method="post" class="form-horizontal"><%--
		<form:hidden path="email" htmlEscape="false" maxlength="255" class="input-xlarge"/>
		<sys:ckfinder input="email" type="files" uploadPath="/mytask" selectMultiple="false"/> --%>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">头像:</label>
            <p id="ctlOnlyP"><img src="" alt="图片" id="ctlImg"/></p>
            <div class="controls">
                <b>上传图片</b>
                <input type="file" class="btn btn-success" name="file_upload" id="file_upload" value="选择图片"/>
            </div>
			<%--<div class="controls">--%>
            <%--<form:hidden id="nameImage" path="photo" htmlEscape="false" maxlength="255" class="input-xlarge"/>--%>
				<%--<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>--%>
			<%--</div>--%>
		</div>
		<div class="control-group">
			<label class="control-label">归属公司:</label>
			<div class="controls">
				<label class="lbl">${user.company.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">归属部门:</label>
			<div class="controls">
				<label class="lbl">${user.office.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">姓名:</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="50" class="required" readonly="true"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">邮箱:</label>
			<div class="controls">
				<form:input path="email" htmlEscape="false" maxlength="50" class="email"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">电话:</label>
			<div class="controls">
				<form:input path="phone" htmlEscape="false" maxlength="50"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">手机:</label>
			<div class="controls">
				<form:input path="mobile" htmlEscape="false" maxlength="50"/>
			</div>
		</div>
        <div class="control-group">
            <label class="control-label">身份证号:</label>
            <div class="controls">
                <form:input path="cardNo" htmlEscape="false" maxlength="50"/>
            </div>
        </div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xlarge"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">用户类型:</label>
			<div class="controls">
				<label class="lbl">${fns:getDictLabel(user.userType, 'sys_user_type', '无')}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">用户角色:</label>
			<div class="controls">
				<label class="lbl">${user.roleNames}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">上次登录:</label>
			<div class="controls">
				<label class="lbl">IP: ${user.oldLoginIp}&nbsp;&nbsp;&nbsp;&nbsp;时间：<fmt:formatDate value="${user.oldLoginDate}" type="both" dateStyle="full"/></label>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" style="width: 280px" type="submit" value="保 存"/>
		</div>
	</form:form>
</body>
</html>